# This file is part of BlackArch Linux ( https://www.blackarch.org/ ).
# See COPYING for license details.

pkgname=recstudio
pkgver=4.1
pkgrel=1
groups=('blackarch' 'blackarch-decompiler' 'blackarch-reversing')
pkgdesc='Cross platform interactive decompiler.'
arch=('x86_64' 'aarch64')
url='http://www.backerstreet.com/rec/recdload.htm'
license=('custom:unknown')
depends=('gtk2')
[[ $CARCH == x86_64 ]] && depends=('lib32-gtk2')
source=('http://www.backerstreet.com/rec/RecStudioLinux.tgz'
        'LICENSE')
sha512sums=('d5c3ca3889a7dc1038a9d03e33b360f6d7e86fb82ef1a5760b44d726d09597ae7f16f443a18ec4c4e238fa5f55c3dcf8a3607d834562151eab9bd4d899891d6d'
            '04807840aa2127abc520c2e068b9eee14cbf5dba6d1faa0bb712387bc46ac6756b7540e3e2edba1a80b3da73aa8eb2acf27a1ae66c3c10c2bb41e3c67dfd72a5')
options=('!strip')

package() {

  install -dm 755 "$pkgdir/usr/bin"
  install -dm 755 "$pkgdir/opt/$pkgname/"{bin,support/Prototypes,support/win32api}

  install -m 755 bin/* "$pkgdir/opt/$pkgname/bin"

  cp --no-preserve=ownership -R support/* "$pkgdir/opt/$pkgname/support"

  install -Dm 644 LICENSE "$pkgdir/usr/share/licenses/$pkgname/LICENSE"

  cat > "$pkgdir/usr/bin/$pkgname" <<EOF
#!/bin/sh
exec /opt/$pkgname/bin/RecStudioLinux
EOF
  chmod +x "$pkgdir/usr/bin/$pkgname"
}

